//键盘接收年，月，日，判断这一天是这一年的第几天

#include <stdio.h>
int main(){
	int year = 0;
	int mouth = 0;
	int day = 0;
	int sum = 0;
	printf("输入年月日用空格隔开：");
	scanf("%d%d%d",&year,&mouth,&day);

	sum = day ;
	mouth = mouth - 1;
	switch(mouth){
		case 11:
			sum = sum + 30;	
		case 10: 
			sum = sum + 31;
		case 9: 
			sum = sum + 30;
		case 8: 
			sum = sum + 31;
		case 7: 
			sum = sum + 31;
		case 6: 
			sum = sum + 30;
		case 5: 
			sum = sum + 31;
		case 4: 
			sum = sum + 30;
		case 3: 
			sum = sum + 31;
		case 2:
			if(year % 4 == 0 && year % 100 != 0 || year % 400 == 0){
				sum = sum + 29;
			} else {	
				sum = sum + 28;
			}
		case 1: 
			sum = sum + 31;
		case 0:
			sum = sum;	
			printf("今天是今年的第%d天\n",sum);
			break;
		default:
			printf("intput error!");
			break;
	}

	return 0;
}
